<?php
namespace app\common\model;

class Enum {
  const PAY_SUCESS = 0;//翼支付
  const PAY_FAILED = 1;//支付失败
  const PAY_WAIT = 2;//待支付
  const PAY_array=[
    '已支付'=>0,'支付失败'=>1,'待支付'=>2
  ];

  const BindCard_SUCESS = 1;//绑定
  const BindCard_FAILED = 0;//解绑

  const PAY_WECHAT = 1;
  
  const ONE_MINUTE=60000;
  const TIME_FORMAT_NUM="20060102150405";

  const b_type_scan = 1;//微信扫码消费
  const b_type_card = 2;//刷卡消费
  const b_type_wxtk = 3;//微信退款

  //中间留一点余地 1开卡赠送 2人工充值 3微信充值 4订单退款 7微信支付 8刷卡支付

  const b_type_cscz = 5;//历史迁移初始金额
  const b_type_kkcz = 6;//开卡充值
  const b_type_rgcz = 7;//人工充值
  const b_type_wxcz = 8;//微信充值
  const b_type_tdcz = 9;//4退单充值
  
  const b_type_array=[
    '迁移金额'=>5,'开卡充值'=>6,'人工充值'=>7,'微信充值'=>8,'订单退款'=>9,'扫码洗衣'=>1,'刷卡洗衣'=>2,'微信退款'=>3
  ];

  const sme_type_array=[
    '待机中'=>0,'预约中'=>1,'消毒清洁中'=>2,'洗衣工作中'=>3,'洗衣机洗涤结束'=>4,'洗衣机自检中'=>5,'进水超时'=>6,'排水超时'=>7,'脱水时撞桶'=>8,'脱水开盖'=>9,'水位传感器异常'=>10,'溢水报警'=>11,'电机故障'=>12
  ];

  const wash_type_array=[
    '单脱'=>'dantuo','标准洗'=>'biaozhun','快洗'=>'kuaixi','大物洗'=>'dawu'
  ];

  //order支付前缀
  const order_type_wxcz = "wxcz";//微信充值
  const order_type_scan = "scan";//直接扫码支付
  const order_type_card = "card";//刷卡支付
  const order_type_rgcz = "rgcz";//人工充值
  const order_type_tdcz = "tdcz";//退单充值
  const order_type_kkcz = "kkcz";//开卡充值
  const order_type_cscz = "cscz";//历史迁移充值

  const wxconfig = array(
    'app_id'=>"wxdedae9ac8da366ad",//小程序id wxb4f3c62fa7640607  wxdedae9ac8da366ad
    'app_secret'=>"52f63748cfe2b33272e7506d04ee1a9c",//小程序key 337f141c6f89d1cf622e2dc7f017b207  52f63748cfe2b33272e7506d04ee1a9c
    'mchid'=>"1523166321",//商户号 1503384701 
    'apikey'=>"537f141c6f89d1cf622e2dc7f017b207",//商户支付key
    'notify_url'=>"https://applet.chubangkj.com/api/Order/notify"//支付异步通知接口
  );


  public static function GetWashType($washtype){
    $re ="";
    switch ($washtype)
    {
      case 1:
        $re = "标准洗";
        break;  
      case 2:
        $re = "快速洗";
        break;
      case 3:
        $re = "单脱水";
        break;
      case 4:
        $re = "大物洗";
        break;
    }
    return $re;
  }

  public static function orderNo($str)
  {
    return $str.date('YmdHis').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
  }

  public static function TransWashType($washtype){
    $re ="";
    switch ($washtype)
    {
      case "dantuo":
        $re = "单脱";
        break;  
      case "biaozhun":
        $re = "标准洗";
        break;
      case "kuaixi":
        $re = "快洗";
        break;
      case "dawu":
        $re = "大物洗";
        break;
    }
    return $re;
  }

  public static function GetWashCommand($washtype){
    $re ="";
    switch ($washtype)
    {
      case 1:
        $re = "biaozhun";
        break;  
      case 2:
        $re = "kuaixi";
        break;
      case 3:
        $re = "dantuo";
        break;
      case 4:
        $re = "dawu";
        break;
    }
    return $re;
  }

  public static function GetWashInt($washtype){
    $re =-1;
    switch ($washtype)
    {
      case "biaozhun":
        $re = 1;
        break;  
      case "kuaixi":
        $re = 2;
        break;
      case "dantuo":
        $re = 3;
        break;
      case "dawu":
        $re = 4;
        break;
    }
    return $re;
  }


  


}

	

	

	
	